package com.zkt.auth.infra.basic.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serial;
import java.time.LocalDateTime;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 权限表
 * </p>
 *
 * @author 赵开泰
 * @since 2025-03-22
 */

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("auth_permission")
public class AuthPermission implements Serializable {
	
	@Serial
	private static final long serialVersionUID = 1L;
	
	/**
	 * 主键
	 */
	@TableId(value = "id")
	private Long id;
	
	/**
	 * 权限名称
	 */
	@TableField("name")
	private String name;
	
	/**
	 * 父id
	 */
	@TableField("parent_id")
	private Long parentId;
	
	/**
	 * 权限类型 0菜单 1操作
	 */
	@TableField("type")
	private Integer type;
	
	/**
	 * 菜单路由
	 */
	@TableField("menu_url")
	private String menuUrl;
	
	/**
	 * 状态 0启用 1禁用
	 */
	@TableField("status")
	private Integer status;
	
	/**
	 * 展示状态 0展示 1隐藏
	 */
	@TableField("`show`")
	private Integer show;
	
	/**
	 * 图标
	 */
	@TableField("icon")
	private String icon;
	
	/**
	 * 权限唯一标识
	 */
	@TableField("permission_key")
	private String permissionKey;
	
	/**
	 * 创建人
	 */
	@TableField(value = "created_by",fill = FieldFill.INSERT)
	private String createdBy;
	
	/**
	 * 创建时间
	 */
	@TableField(value = "created_time",fill = FieldFill.INSERT)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime createdTime;
	
	/**
	 * 更新人
	 */
	@TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
	private String updateBy;
	
	/**
	 * 更新时间
	 */
	@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime updateTime;
	
	/**
	 * 逻辑删除
	 */
	@TableField(value = "is_deleted", fill = FieldFill.INSERT)
	private Integer isDeleted;
	
}
